feat(astro): add @json-render/astro SSR HTML renderer#218
Open
Aperrix wants to merge 10 commits intovercel-labs:mainfrom
Open
feat(astro): add @json-render/astro SSR HTML renderer#218Aperrix wants to merge 10 commits intovercel-labs:mainfrom
Aperrix wants to merge 10 commits intovercel-labs:mainfrom
Conversation
Contributor
|
@Aperrix is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
New package that transforms json-render specs into HTML strings on the server. Zero framework dependencies — works in Astro, Cloudflare Workers, Node.js, Deno, Bun. Includes schema, catalog types, renderToHtml(), escapeHtml(), and full test suite.
- Package README with Astro and Cloudflare Workers examples - Skill file for AI agents - API reference page for docs site - Root README updated with package table entry and renderer section - Changeset config, docs navigation, page titles, and docs-chat updated
Minimal Astro app demonstrating renderToHtml() with set:html, including visibility conditions, repeat, $cond expressions, and a registry of pure HTML component render functions.
…time state Add 8 new tests covering SSR safety: - No DOM globals dependency - Synchronous output (no promises) - No script tags or event handlers in output - XSS escaping in HTML attributes (href, src, alt) - Unicode content handling - Request-time state resolution (per-request rendering) - No caching leak between renders - Repeat with $index for position-aware rendering Example now demonstrates server-side state injection with timestamp.
Add islands demo page showing @json-render/astro (static SSR) coexisting with @json-render/react (interactive island hydrated via client:visible). Document the islands pattern for all 4 supported frameworks (React, Vue, Svelte, Solid) in package README, skill file, and API docs page.
…igation Counter.tsx now uses defineRegistry's createHandlers with refs pattern (matching dashboard example) instead of disconnected no-op actions. Fixes provider order to StateProvider > VisibilityProvider > ActionProvider.
… Renderer
Replace string-based renderToHtml() with native .astro components:
- Renderer.astro and ElementRenderer.astro for recursive spec tree walking
- defineRegistry(catalog, { components }) matching React/Vue/Svelte/Solid API
- Astro-specific schema with static HTML rules (no actions/events)
- Example .astro components (Section, Card, Heading, Text, Badge, List, etc.)
- Full test suite (schema, catalog, registry, public API exports)
- Aligned docs (README, SKILL.md, web API page) with other renderer packages
- Updated changeset for v0.14 release
1924cec to
71dbc33
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@json-render/astro, an Astro renderer withdefineRegistry+<Renderer />for native.astrocomponents. Same API pattern as React, Vue, Svelte, and Solid renderers.defineRegistry(catalog, { components })creates a typed component registry;<Renderer />walks the spec tree rendering each element using real.astrofiles with<slot />for children<ElementRenderer />usesAstro.selffor recursive tree walking (visibility, props resolution, repeat)@json-render/astro+ interactive islands via@json-render/react(or Vue, Svelte, Solid) withclient:*directives$state,$cond,$item,$index,$template,visible, andrepeatexpressionsexamples/astro/) with static demo and hybrid React island counterTest plan
pnpm buildinexamples/astro/)defineRegistry+createHandlerspattern with proper provider order (StateProvider > VisibilityProvider > ActionProvider)